# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html

import scrapy


class BaseItem(scrapy.Item):
    """基础Item类"""
    # 通用字段
    url = scrapy.Field()  # 来源URL
    source = scrapy.Field()  # 数据来源
    crawl_time = scrapy.Field()  # 爬取时间
    spider_name = scrapy.Field()  # 爬虫名称


class ArticleItem(BaseItem):
    """文章Item类"""
    title = scrapy.Field()  # 标题
    content = scrapy.Field()  # 内容
    author = scrapy.Field()  # 作者
    publish_time = scrapy.Field()  # 发布时间
    category = scrapy.Field()  # 分类
    tags = scrapy.Field()  # 标签
    comments = scrapy.Field()  # 评论数
    likes = scrapy.Field()  # 点赞数


class ProductItem(BaseItem):
    """商品Item类"""
    product_id = scrapy.Field()  # 商品ID
    name = scrapy.Field()  # 商品名称
    price = scrapy.Field()  # 价格
    original_price = scrapy.Field()  # 原价
    description = scrapy.Field()  # 描述
    brand = scrapy.Field()  # 品牌
    category = scrapy.Field()  # 分类
    images = scrapy.Field()  # 图片URL列表
    ratings = scrapy.Field()  # 评分
    reviews_count = scrapy.Field()  # 评价数量
    stock = scrapy.Field()  # 库存
